<!doctype html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<title>windows路径转换为Linux路径</title>
	</head>

	<body>
        <div>
            <p style="color:green">在windows路径下的框中粘贴windows系统下的文件路径，然后鼠标移出框就会转换出来路径</p>
            <p>测试路径</p>
            <input type="text" value="C:\Windows\System32\drivers\etc\" style="width:90%;">
        </div>
		windows路径:
		<br />
		<textarea rows="10" cols="100" style="resize: none;border:2px solid red;" id="in" onmouseout="parse()"></textarea>
		<br />
		Linux路径:
		<br />
		<textarea rows="10" cols="100" style="resize: none;border:2px solid blue;" id="out" onmouseout="parse()"></textarea>
		<script type="text/javascript">
			function parse() {
				var input = document.querySelector("#in");
				var out = document.querySelector("#out");
				var text = input.value;
				text = text.replace(/\\/g, "/");
				out.value = text;
			}
		</script>
	</body>

</html>